package com.echartsdata.Entityimp;

import com.alibaba.fastjson2.JSONObject;
import com.echartsdata.Mapper.Data1Mapper;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
@Component
//数据接口实现处理
public class Data1Mapperimp {
    @Resource
    private Data1Mapper data1Mapper;
    //返回接口数据
    public String getData1() {
        System.out.println("看看接口数据返回的什么数据"+data1Mapper.GetData());
        JSONObject jsonObject = new JSONObject();
        //将数据转化成Json数据
        jsonObject.put("data", data1Mapper.GetData());
        System.out.println("转换后的json数据是"+jsonObject.toString());
        return jsonObject.toJSONString();

    }
}
